﻿using Abp.IdentityServer4;
using Microsoft.EntityFrameworkCore;
using Abp.Zero.EntityFrameworkCore;
using Abp.Ids4.Authorization.Roles;
using Abp.Ids4.Authorization.Users;
using Abp.Ids4.MultiTenancy;

namespace Abp.Ids4.EntityFrameworkCore
{
    public class Ids4DbContext : AbpZeroDbContext<Tenant, Role, User, Ids4DbContext>, IAbpPersistedGrantDbContext
    {
        public DbSet<PersistedGrantEntity> PersistedGrants { get; set; }
        /* Define a DbSet for each entity of the application */

        public Ids4DbContext(DbContextOptions<Ids4DbContext> options)
            : base(options)
        {
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.ConfigurePersistedGrantEntity();
        }
    }
}
